package tests;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import conference.Conference;
import conference.ConferenceIO;
import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import users.Author;
import users.ProgramChair;
import users.User;

public class ConferenceIOTest {

	Conference my_conference;
	List<User> my_users;
	
	
	@Before
	public void setUp() {
		my_users = new ArrayList<User>();
		for (int i = 0; i < 20; i++) {
			Author author = new Author("Matt Minch" + i);
			my_users.add(author);
		}
		my_conference = new Conference(new ProgramChair("Matt Minch"), 
				"Conference Pony", new Date(), new Date(), my_users);
	}

	@Test
	public void testSaveConference() {
		assertEquals("should return true", true,
				ConferenceIO.saveConference("/Users/taytay845/Desktop", my_conference));
	}

	@Test
	public void testLoadConference() {
		assertEquals("should return ConfA", my_conference.toString(), 
				ConferenceIO.loadConference("/Users/taytay845/Desktop", "Conference Pony").toString());
	}

}
